<template>
	<view class="house-container" @click="navigator">
		<view class="house-image">
			<image :src="info.images && info.images[0]" mode="scaleToFill" style="width: 100%;height: 100%;"></image>
		</view>
		<view class="house-info">
			<view class="house-title">
				{{info.rental}}｜{{info.rooms}}室{{info.hall}}厅｜{{info.facing}}
			</view>
			<view class="house-require">
				{{info.metre}}平｜{{info.address}}
			</view>
			<view class="house-tag">
				<view class="house-tag-item" v-for="(item,index) in info.facilities" :key="index">
					{{item}}
				</view>
			</view>
			<view class="house-price">
				{{info.price}}
			</view>
			<view class="house-source">
				信息来源：{{info.role_type == 'role_normal'?'个人发布':info.role_type == 'role_comp'?'企业发布':info.role_type == 'role_manager'?'平台发布':'-'}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			info: {
				default: () => {
					return {}
				}
			},
		},
		methods: {
			navigator(){
				uni.navigateTo({
					url: "/pages/house_detail/index"
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.house-container{
		margin: 20rpx auto;
		width: 692rpx;
		background-color: #fff;
		padding: 24rpx;
		box-sizing: border-box;
		border-radius: 20rpx;
		display: flex;
		align-items: center;
		.house-image{
			margin-right: 26rpx;
			width: 284rpx;
			height: 218rpx;
			background-color: #ccc;
			border-radius: 8rpx;
			overflow: hidden;
		}
		.house-info{
			flex: 1;
			height: 218rpx;
			.house-title{
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
				color: #000000;
				font-size: 34rpx;
				font-weight: bold;
			}
			.house-require{
				margin: 10rpx 0;
				font-weight: 400;
				font-size: 24rpx;
				color: #9E9E9E;
				line-height: 30rpx;
				overflow: hidden;
				text-overflow: ellipsis;
			}
			.house-tag{
				margin: 10rpx 0;
				display: flex;
				align-items: center;
				.house-tag-item{
					padding: 0 16rpx;
					background-color: #E9F1FF;
					line-height: 40rpx;
					font-size: 24rpx;
					color: #005DFF;
					text-align: center;
					border-radius: 46rpx;
				}
				.house-tag-item+.house-tag-item{
					margin-left: 12rpx;
				}
			}
			.house-price{
				margin: 12rpx 0;
				font-weight: bold;
				font-size: 27rpx;
				color: #005DFF;
			}
			.house-source{
				font-size: 24rpx;
				color: #9E9E9E;
				line-height: 40rpx;
			}
		}
	}
</style>